package com.z996.spring6;

import com.z996.spring6.config.Spring6Config;
import com.z996.spring6.controller.UserController;
import org.junit.jupiter.api.Test;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.context.ApplicationContext;
import org.springframework.context.annotation.AnnotationConfigApplicationContext;

/**
 * 简述:<br>
 * 测试 Spring 全注解开发
 *
 * @Author zfh18
 * @Date 2024-03-01 17:16
 * @Version 1.0
 **/
public class ConfigAutoSetTest {
    private Logger logger = LoggerFactory.getLogger(ConfigAutoSetTest.class);

    @Test
    public void test() {
        ApplicationContext context = new AnnotationConfigApplicationContext(Spring6Config.class);
        UserController userController = context.getBean("userController", UserController.class);
        userController.add();
        logger.info("执行成功");
    }
}
